home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Commodities / ColorSaver / Dimmer.rexx < prev    next >
OS/2 REXX Batch file  |  1996-09-26  |  1KB  |  46 lines

  1. /*
  2.  * ColorSaver ARexx example
  3.  * ColorSaver needs to be running.....
  4.  *
  5.  * Dim's the screen by setting all of the colors to half their
  6.  * present value, delays a bit, then returns the screen to normal
  7.  */
  8.  
  9. Options FailAt 100
  10. Options Results
  11.  
  12. Delay = 10
  13.  
  14. if ~show(p, 'COLORSAVER.1') then
  15. do
  16.    Say ' '
  17.    Say 'Please start COLORSAVER first...'
  18.    exit
  19. end
  20.  
  21. Address COLORSAVER.1 STOREPALETTE
  22.  
  23. Say ' '
  24. Say ' This ColorSaver ARexx example will dim your screen by setting'
  25. Say ' each color value to half it''s present value.  The screen will'
  26. Say ' remain dimmed for 'delay' seconds, then be returned to normal'
  27. Say ' '
  28.  
  29. Address COLORSAVER.1 NUMCOLORS          /* get number of colors */
  30. Parse VAR Result Count
  31.  
  32.  do i=0 to Count-1
  33.   Address 'COLORSAVER.1' 'SELECT' i
  34.   Address COLORSAVER.1 GETRGB
  35.   Parse VAR Result Red Green Blue
  36.   Red = Red/2
  37.   Blue = Blue/2
  38.   Green = Green/2
  39. /*  Say 'Color = 'i 'R = 'Red 'G = ' Green 'B = 'Blue */
  40.   Address 'COLORSAVER.1' 'SETRGB Color='i', R='Red', G='Green', B='Blue
  41.  end
  42.  
  43. Address COMMAND wait delay
  44. Address COLORSAVER.1 CANCEL
  45.  
  46.